package com.bgt.springboot.first.mapper;

/**
 * Created by baiguantao on 2017/4/26.
 */

import com.bgt.springboot.first.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 整合mybatis版本
 */
@Mapper
public interface UserMapper {
    @Select("SELECT * FROM USER WHERE age = #{age}")
    List<User> findByName(@Param("age") Integer age);
    @Insert("INSERT INTO USER(AGE) VALUES(#{name}, #{age})")
    int insert(@Param("age") Integer age);
}